Skip to content

8348402: PerfDataManager stalls shutdown for 1ms #2058

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GoeLin
Copy link
Member

@GoeLin GoeLin commented Aug 6, 2025

I backport this for parity with 21.0.9-oracle.

src/hotspot/share/runtime/objectMonitor.cpp
Resolved as comments in context are different.

src/hotspot/share/runtime/perfData.hpp
Copyright

src/hotspot/share/runtime/synchronizer.cpp
Resolved #include.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • JDK-8348402 needs maintainer approval

Issue

  • JDK-8348402: PerfDataManager stalls shutdown for 1ms (Enhancement - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk21u-dev.git pull/2058/head:pull/2058
$ git checkout pull/2058

Update a local copy of the PR:
$ git checkout pull/2058
$ git pull https://git.openjdk.org/jdk21u-dev.git pull/2058/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2058

View PR using the GUI difftool:
$ git pr show -t 2058

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk21u-dev/pull/2058.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 6, 2025

👋 Welcome back goetz! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@GoeLin GoeLin changed the title Goetz backport 8348402 backport 305bbdae7fe40e33cf2baa100c134bd85ecaa553 Aug 6, 2025
@openjdk
Copy link

openjdk bot commented Aug 6, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title backport 305bbdae7fe40e33cf2baa100c134bd85ecaa553 8348402: PerfDataManager stalls shutdown for 1ms Aug 6, 2025
@openjdk
Copy link

openjdk bot commented Aug 6, 2025

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk bot added backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required labels Aug 6, 2025
@openjdk
Copy link

openjdk bot commented Aug 6, 2025

⚠️ @GoeLin This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 6, 2025
@mlbridge
Copy link

mlbridge bot commented Aug 6, 2025

Webrevs

Copy link
Member

@shipilev shipilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backport itself looks good.

But I have a small doubt we should do it for JDK 21. Catching the critical section for FutileWakeups increment might be not worth it. In mainline, we have deleted these after replacing these PerfData events with related JFR events (https://bugs.openjdk.org/browse/JDK-8348829).

But it is a minor risk, so I would not be against it as well.

@GoeLin
Copy link
Member Author

GoeLin commented Aug 7, 2025

OK, I can set it aside for now and pick it up again if there is an additional trigger to backport it.

@shipilev
Copy link
Member

shipilev commented Aug 7, 2025

OK, I can set it aside for now and pick it up again if there is an additional trigger to backport it.

I am not blocking this, just giving a perspective :)

(+): The positive impact on small applications is noticeable. We have argued about the negative impact back when it was done in mainline, and reasoned it is minor at worst. The synchronization is on FutuleWakeups path, where we already are in the world of pain.
(+): Doing the proper CS synchronization between perf data counters and their manager allows more reliable shutdown. I can see how this might mitigate some JVM shutdown crashes in the wild.
(-): We see lots of performance-sensitive applications run with -XX:-UsePerfData, where neither of these issues manifest. So the positive impact is smaller.
(-): Since this CS-taking code path is summarily removed in JDK 25. So if we backport, only JDK 21 would be taking it. This also tells us waiting for real-world JDK 25 testing is futile, since there is nothing to test.

So on balance, we can take it into JDK 21. Let's not do any prior releases, though.

@GoeLin GoeLin closed this Aug 11, 2025
@GoeLin GoeLin reopened this Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Port of a pull request already in a different code base clean Identical backport; no merge resolution required rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants